<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../ext-4.0/resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext-4.0/bootstrap.js"></script>
<script type="text/javascript" src="../../ext-4.0/locale/ext-lang-zh_CN.js"></script>
<style type="text/css">
body{
	font-size:11pt;
	color:black;
	padding:5px;
	font-family:'Arial';
}
</style>
<script language="javascript">
	Ext.onReady(function(){
		var panel = new Ext.Panel({
			title : '集合调用Ext.each的处理',
			width : '280px',
			renderTo : 'sub1',
			html : '<div style="height:160px"></div>'
		});
		//定义两个对象,一个目标对象一个源对象
		var tarObj = {},srcObj
		srcObj = {};
		srcObj.name = "源对象";
		srcObj.text = "我的文本内容已经从srcObj中拷贝过来了";
		srcObj.width = "130px";
		//调用Ext.apply进行处理,从srcObj中拷贝属性到tarObj中
		Ext.apply(tarObj,srcObj);
		Ext.Msg.alert('Ext.apply示例',"tarObj的属性如下:<br>name:"+
				tarObj.name+"<br>text:"+tarObj.text+
				"<br>width:"+tarObj.width);
	});
</script>
</head>
<body>
	<div id="sub1"></div>
</body>
</html>
